#ifndef __PID_H__
#define __PID_H__





typedef struct
{
    // Kp -  proportional gain
    // Ki -  Integral gain
    // Kd -  derivative gain
    // dt -  loop interval time
    // max - maximum value of manipulated variable
    // min - minimum value of manipulated variable
    float kp;
    float kd;
    float ki; 
    
//    double dt;
    
    float max;
//    float min;

    float last_error;
    
    float integral;
    float max_integral;
	
	float output;
	float last_output;
    
}pid_controller_t;





float pid_clc(pid_controller_t *pid, float curr, float target);

void pid_init(pid_controller_t *pid, float kp, float ki, float kd);








#endif

